package com.dz.risk.pojo.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.dz.risk.validation.Add;
import com.dz.risk.validation.Update;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 系统阈值配置表
 *
 * @author Doke
 * @date 2021/07/09 10:57:15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@Builder
@ApiModel(value = " ConfigEntity : 系统阈值实体")
@TableName(value = "t_st_config")
public class ConfigEntity {

    public interface AddConfigType {
    }

    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键,自动递增")
    @NotNull(message = "Id不能为空", groups = {Update.class})
    private Integer id;

    /**
     * 配置项
     */
    @ApiModelProperty(value = "配置项类型")
    @NotBlank(message = "配置项不能为空", groups = {AddConfigType.class, Add.class, Update.class})
    private String configType;

    /**
     * 配置项代码
     */
    @NotNull(message = "配置项代码不能为空", groups = {AddConfigType.class,Add.class, Update.class})
    @ApiModelProperty(value = "配置项代码")
    private Integer configTypeCode;

    /**
     * 配置字段名称
     */
    @NotBlank(message = "配置字段名称不能为空", groups = {Add.class, Update.class})
    @ApiModelProperty(value = "配置字段名称")
    private String configName;

    /**
     * 配置字段值
     */
    @ApiModelProperty(value = "配置字段值")
    private String configValue;

    /**
     * 排序号
     */
    @ApiModelProperty(value = "排序号")
    private Integer serialNumber;

    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    @TableField(fill = FieldFill.INSERT)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String createdUser;

    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String updatedUser;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Date createdTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Date updatedTime;

    /**
     * 是否删除：false 不删除，true 删除
     */
    @TableLogic(value = "false", delval = "true")
    @ApiModelProperty(value = "是否删除：false 不删除，true 删除")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Boolean delFlag;
}